package cc.rengu.redp.bizimpl.upmp.service;

import cc.rengu.redp.bizimpl.upmp.domain.UpmpOrgTreeInfo;
import cc.rengu.redp.bizimpl.upmp.domain.UpmpOrganization;
import cc.rengu.redp.bizimpl.upmp.vo.UpmpOrganizationVO;
import cc.rengu.redp.bizimpl.upmp.vo.UpmpUserInfoVO;
import cc.rengu.redp.common.domain.QueryRequest;
import cc.rengu.redp.common.exception.RedpException;
import com.baomidou.mybatisplus.extension.service.IService;

import java.util.List;
import java.util.Map;

/**
 * @author System
 */
public interface IUpmpOrganizationService extends IService<UpmpOrganization> {
//    IPage<UpmpOrganizationVO> findPageList(UpmpOrganizationVO organization, QueryRequest queryRequest);

    Map<String, Object> findOrgTrees(UpmpOrganizationVO organization);

    List<UpmpOrgTreeInfo> getAllOrgForTree(String code, String instId, List<UpmpOrgTreeInfo> result);

    List<UpmpOrganization> findList(UpmpOrganizationVO organization);

    void add(UpmpOrganizationVO organization) throws RedpException;

    void update(UpmpOrganizationVO organization) throws RedpException;

    /**
     * 递归删除机构
     *
     * @param orgIds orgIds
     */
    void delete(String[] orgIds) throws Exception;

    UpmpOrganization getOrgByUser(UpmpUserInfoVO user, String instId);

    UpmpOrganization getOrgByCode(String code, String instId);

    //TODO 后续增加发法人行此方法需要更改
    UpmpOrganization getHeadOrgByCode(String instId);

    UpmpOrganization findOneByCode(String signInstId, String status, String instId);

    Map<String, Object> organizationSelect2List(QueryRequest request, UpmpOrganization upmp);

    Map<String, Object> orgoneSelect2List(QueryRequest request, String q);

    List<UpmpOrganization> getOrgListByParentCode(String parentCode, String instId);

    String selectOrgByCode(String code);

    Map<String, Object> organizationSelectList(QueryRequest request, UpmpOrganization organization);
}
